<style type="text/css">
    .bjui-pageHeader{
        font-size: 18px;
        font-weight: bold;
    }
    .form{
        padding: 15px;
    }
    .form dl {
        overflow: hidden;
        padding-top: 15px;
    }

    .form dt {
        color: #666;
        float: left;
        font-size: 14px;
        padding: 3px 0 0;
        width: 11%;
    }
    .form dd {
        float: left;
        line-height: 22px;
    }
    dd.desc {
        height: 30px;
        padding: 0 10px;
        width: 150px;
    }
    .title {
        line-height: 14px;
        font-weight: bold;
        margin-top: 10px;
        margin-bottom: 8px;
        padding-bottom: 8px;
        border-bottom: 2px solid #e9e9e9;
    }
    .token li{
        line-height: 30px;
    }
    .weimain{
        padding: 5px;
    }
</style>
<div class="bjui-pageHeader">
    <div class="glyphicon glyphicon-th-large">菜单列表</div>
</div>
<div class="bjui-pageContent">
    <div class="weimain">
        <form action="{:U('Wechatauth/editHuiType')}" method="post" data-toggle="validate">
            <div class="weixin">
                <div class="title">服务器配置</div>
                <div class="token">
                    <ul>
                        <li>
                            <span>&nbsp;&nbsp;A P P I D:</span>
                            <input type="text" name="cfg_wechat_appid" value="{$Think.config.cfg_wechat_appid}" class="inp" size="50"></li>
                        <li>
                            <span>Appsecret:</span>
                            <input type="text" name="cfg_wechat_appsecret" value="{$Think.config.cfg_wechat_appsecret}" class="inp" size="50"></li>
                        <li></li>
                        <li></li>
                    </ul>
                </div>
                <button type="submit" class=" btn-default" data-icon="save">保存</button>
            </div>
        </form>

        <div class="title">
            菜单配置 <font color="red" size="2px;">目前自定义菜单最多包括3个一级菜单，每个一级菜单最多包含5个二级菜单。一级菜单最多4个汉字，二级菜单最多7个汉字，多出来的部分将会以“...”代替。请注意，创建自定义菜单后，由于微信客户端缓存，需要24小时微信客户端才会展现出来。或重新关注公众号也会看到效果.</font> 
        </div>

        <button type="button" data-url="{:U('Wechatauth/addMenu',array('action'=>
            'add'))}" class="btn-green" data-toggle="dialog" data-id="Wechat-awords" data-title="添加菜单" data-width="560" data-height="300" data-icon="plus">添加菜单
        </button>
        <a href="{:U('Wechatauth/reloadMenu')}" class="btn btn-red" data-toggle="doajax" data-confirm-msg="确定要发布到微信吗？" data-type="get" data-icon="share-square-o">发布到微信
        </a>
        <font color="red" size="2px;">无论下面操作 增，删，改等操作都必须发布到微信才真正有效！</font>

        <div class="list">

            <table class="table table-bordered table-hover table-striped table-top">
                <thead>
                    <tr>
                        <th>编号</th>
                        <th>名称</th>
                        <th>绑定信息</th>
                        <th>排序</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    <foreach name='menus' item='v'>
                        <tr>
                            <td>{$v.id}</td>
                            <td class="aleft">
                                <if condition="$v['pid'] neq 0">&nbsp;&nbsp;&nbsp;&nbsp;├─</if>
                                {$v.title}
                            </td>
                            <td >
                            <if condition="$v['pid'] neq 0">
                                <if condition="$v['type'] eq 0">绑定网址：</if>
                                <if condition="$v['type'] eq 1">绑定词语：</if>
                                <if condition="$v['type'] eq 2">绑定栏目：</if>
                                {$v.url}
                            </if>
                            </td>
                            <td>
                                <input type="text" name="{$v.id}" value="{$v.sort}" />
                            </td>
                            <td>
                                <a href="{:U('Wechatauth/addMenu',array('pid'=>
                                    $v['id'],'action'=>'addchild'))}" data-toggle="dialog" data-id="Wechat-awords" data-title="添加菜单" data-width="560" data-height="300">添加子栏目
                                </a>
                                <a href="{:U('Wechatauth/addMenu',array('id'=>
                                    $v['id'],'action'=>'edit'))}" data-toggle="dialog" data-id="Wechat-awords" data-title="添加菜单" data-width="560" data-height="300">修改
                                </a>
                                <a href="{:U('Wechatauth/del', array('id' =>$v['id']))}"  data-toggle="doajax" data-confirm-msg="确定要删除吗？" data-type="get">删除</a>
                            </td>
                        </tr>
                    </foreach>
                </tbody>
            </table>
        </div>
    </div>
</div>
<div class="bjui-pageFooter">
    <ul>
        <li>
            <button type="button" class="btn-close" data-icon="close">关闭</button>
        </li>
    </ul>
</div>